package com.dong.factory;

import com.dong.bean.Fly;
import com.dong.config.T024FactoryBeanConfig;
import org.springframework.beans.factory.FactoryBean;

/**
 * 用于测试FactoryBean方式向容器注册组件
 * @see T024FactoryBeanConfig
 */
public class MyFactoryBean implements FactoryBean<Fly> {
    @Override
    public Fly getObject() throws Exception {
        return new Fly();
    }

    @Override
    public Class<?> getObjectType() {
        return Fly.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
